import * as types from '../mutation-types'

const state = {
  count: 10
}

const getters = {
  getCount: state => state.count
}

const actions = {
  increment({ commit }) {
    commit(types.INCREMENT)
  },
  decrement({ commit }) {
    commit(types.DECREMENT)
  }
}

const mutations = {
  [types.INCREMENT](state) {
    state.count++
  },
  [types.DECREMENT](state) {
    state.count--
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}
